package cn.sail.spring.ioc.util;

import cn.sail.spring.ioc.service.CatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class BeanUtil {

    @Autowired
    private CatService catService;

    /**
     * 返回一个spring容器中的对象
     *
     * @return
     */
    public Object getBean() {
        return catService;
    }

    public static void main(String[] args) {
        Object bean = new BeanUtil().getBean();
        System.out.println(bean);
    }
}
